}
trk->creation_time = itm->timestamp; // in UTC..
if (bmask & (1<<MILLISECOND)) {
- trk->microseconds = MILLI_TO_MICRO(itm->timestamp_ms);
+ trk->creation_time = trk->creation_time.addMSecs(itm->timestamp_ms);
}
if (bmask & (1<<PDOP)) {
void
ozi_set_time_str(const char *str, waypoint *waypointp)
{
- double ozi_time;
- const char *dot;
- int len;
-
- ozi_time = atof(str);
- waypointp->SetCreationTime((ozi_time - DAYS_SINCE_1990) * SECONDS_PER_DAY);
-
- dot = strchr(str, '.');
- /* get number of characters after dot */
- len = (dot) ? strlen(str) - (dot - str) - 1 : 0;
- if (len >= 7) {
- /* with default ozi time precision (%.7f) we can only handle tenths of second */
- ozi_time -= ((double)waypointp->creation_time / SECONDS_PER_DAY) + DAYS_SINCE_1990;
- ozi_time *= SECONDS_PER_DAY;
- waypointp->microseconds = (ozi_time * 10) + 0.5;
- if (waypointp->microseconds == 10) {
- waypointp->creation_time++;
- waypointp->microseconds = 0;
- }
- waypointp->microseconds *= 100000;
- }
+ double ozi_time = atof(str);
+
+ waypointp->SetCreationTime((ozi_time - DAYS_SINCE_1990) * SECONDS_PER_DAY,
+ 1000000 * (ozi_time - (int) ozi_time));
}
static void
<rte>
<name>1 COSTANERO JA</name>
<rtept lat="-34.445850000" lon="-58.523720000">
- <time>2010-11-25T20:26:00Z</time>
+ <time>2010-11-25T20:26:00.851Z</time>
<name>MPCHIC</name>
<cmt>MARINA PUNTA CHICA</cmt>
<desc>MARINA PUNTA CHICA</desc>
</rtept>
<rtept lat="-34.447380000" lon="-58.507270000">
- <time>2013-03-11T19:52:37Z</time>
+ <time>2013-03-11T19:52:36.828Z</time>
<name>JA12</name>
</rtept>
</rte>
<desc>07-OCT-00 18:22</desc>
</rtept>
<rtept lat="-34.477470000" lon="-57.861670000">
- <time>2012-09-02T00:05:55Z</time>
+ <time>2012-09-02T00:05:55.004Z</time>
<name>COLBO3W </name>
</rtept>
</rte>